package com.tensquare.test.serarch.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;

@Document(indexName = "tensquare_article",type = "article")
public class Article implements Serializable {

    @Id
    private String id ;

    /*
    *  index           -索引：看该域是否能被搜索
    *  analyzer        -分词：搜索的时候是整体匹配还是单词匹配
    *  searchAnalyzer： -存储：是否在页面显示
    * */
    @Field(index=true,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private  String title ;

    @Field(index=true,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String content ;

    private String state ;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }
}
